package com.itheima.demo10.ArrayMethodReference;

public class Demo {
    public static void main(String[] args) {
        int[] arr1 = createArray(10, (len) -> {
            return new int[len];
        });
        int[] arr2 = createArray(10, int[]::new);
        System.out.println(arr1.length);
        System.out.println(arr2.length);
    }

    public static int[] createArray(int length, ArrayBuilder ab) {
        return ab.builderArray(length);
    }
}
